<table width="100%" border="0" cellpadding="5">
{foreach from=$root_categories item=_cat name=_fr}
	{if $smarty.foreach._fr.index%$columnCount ==0}<tr class="catalog_list">{/if}
	{assign var=_cat_url value="?categoryID=`$_cat.categoryID`&category_slug=`$_cat.slug`"|set_query_html}
	
	{if $_cat.picture ne "" && $PAGE_VIEW ne 'mobile'}
	<td width="1%" align="center" class="c_img">
	<a href='{$_cat_url}'>
		<img border="0" src="{$smarty.const.URL_PRODUCTS_PICTURES}/{$_cat.picture|escape:'url'}" alt="{$_cat.name|escape:'html'}">
	</a>
	</td>
	{else}
	<td width="1%" align="center" class="c_img">
	<a href='{$_cat_url}' class="home_page_category_logo">
		
	</a>
	</td>
	{/if}

	<td class="c_item">
		<a href='{$_cat_url}' class="c_title">{$_cat.name|escape:'html'|default:'(no name)'}</a>
		<ul class="c_list">
		{* show sub categories *}
{foreach name=sub_cat_list from=$root_categories_subs[$_cat.categoryID] item=_subcat}
	{if $subcategories_numberlimit && (!$smarty.foreach.sub_cat_list.first)&&($smarty.foreach.sub_cat_list.iteration==$subcategories_numberlimit)}
		
	{elseif !$subcategories_numberlimit||$subcategories_numberlimit&&($smarty.foreach.sub_cat_list.iteration<$subcategories_numberlimit)}			
		<li><a href='{"?categoryID=`$_subcat.categoryID`&category_slug=`$_subcat.slug`"|set_query_html}'>{$_subcat.name|escape:'html'}</a></li>
	{/if}
{/foreach}
		</ul>
	</td>
	{if ($smarty.foreach._fr.index+1)%$columnCount ==0}</tr>{/if}
{/foreach}
</table>